#pragma once
#include "Prop.h"


class CPlayer;

class CBall 
	: public CProp
{
public:
	CBall();
	~CBall();
	void Update(float elapsedTime) override;
	void Render(void)			   override;

	int GetType() const { return ENT_BALL; }

	/*virtual*/ void HandleCollision(const Entity* pOther);	/*override*/
	virtual void HandleEvent(const SGD::Event* pEvent) override;
	// Accessors
	CPlayer* GetOwner()const { return m_pOwner; }
	int GetPowerLevel() { return m_nPowerLevel; }

	// Mutators
	void SetOwner(CPlayer* owner){ m_pOwner = owner; }
	void SetPowerLevel(int i){ m_nPowerLevel = i; }

	void Rebound();
	bool m_bMiniGame = false;
	//void HandleEvent(const SGD::Event* pEvent) override;

	void Explosion();

	void SetTimer(float time){ bombtimer = time; }
	float GetTimer(){ return bombtimer; }


	bool explosion = false;
	bool spawn = true;
private:
	float m_fXVelocity;
	float m_fYVelocity;
	CPlayer* m_pOwner;
	int m_nPowerLevel = 0;
	float bombtimer = 5.0f;
};

